package com.zx.erp.purchase.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zx.erp.market.bean.Custom;
import com.zx.erp.purchase.bean.CType;
import com.zx.erp.purchase.mapper.CTypeMapper;
import com.zx.erp.purchase.service.CTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 作者信息
 * @since 2021-11-10
 */
@Service
public class CTypeServiceImpl extends ServiceImpl<CTypeMapper, CType> implements CTypeService {
@Autowired
    private CTypeMapper cTypeMapper;

    @Override
    public List<CType> selecttype(CType cType) {
        return cTypeMapper.selecttype(cType);
    }
    @Override
    public List<CType> findbyBrandId(Integer brandid) {
        return cTypeMapper.selectbyBrandId(brandid);
    }
    @Override
    public PageInfo<CType> findAll(CType cType, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo,pageSize);
        List<CType> cTypes = cTypeMapper.selectAll(cType);
        PageInfo<CType> pageInfo=new PageInfo<CType>(cTypes);
        return pageInfo;
    }
}
